package net.xiduth.utils.npc;

import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.util.HashMap;
import java.util.Map;

import net.xiduth.game.World;
import net.xiduth.game.WorldObject;
import net.xiduth.game.WorldTile;
import net.xiduth.game.npc.NPC;
import net.xiduth.utils.FileUtilities;
import net.xiduth.utils.Utils.EntityDirection;

public class NPCSpawning {

	public static void spawnNPCS() {
		/*//TzHaar-Mej spawned by oracle
7753 - 3682 2976 0 */
		World.spawnNPC(7753, new WorldTile(3682, 2976, 0), -1, false,
				EntityDirection.SOUTH);
		
		World.spawnNPC(2998, new WorldTile(3688, 2971, 0), -1, false, EntityDirection.WEST);
	/**
	 * 
	 * 
	 * 
	 * 
	 * START OF NEW HOME
	 * 
	 * 
	 * 
	 */
		/*//Soldier spawned by oracle
		1063 - 4526 5653 0 */
		World.spawnNPC(1063, new WorldTile(4526, 5653, 0), -1, false,
				EntityDirection.WEST);
		/*//Hans spawned by oracle
		7935 - 4526 5654 0 */
		World.spawnNPC(7935, new WorldTile(4526, 5654, 0), -1, false,
				EntityDirection.WEST);
		/*//Jatix spawned by oracle
		587 - 4526 5649 0 */
		World.spawnNPC(587, new WorldTile(4526, 5649, 0), -1, false,
				EntityDirection.WEST);
		/*//Banker spawned by oracle
		494 - 4526 5655 0 */
		World.spawnNPC(494, new WorldTile(4526, 5655, 0), -1, false,
				EntityDirection.WEST);
		/*//Thok, Master of Dungeoneering spawned by oracle
		9713 - 4524 5656 0 */
		World.spawnNPC(9713, new WorldTile(4524, 5656, 0), -1, false,
				EntityDirection.SOUTH);
		/*//Thessalia spawned by oracle
		548 - 4526 5646 0 */
		World.spawnNPC(548, new WorldTile(4526, 5646, 0), -1, false,
				EntityDirection.NORTH);
		/* //Hairdresser spawned by oracle
		598 - 4525 5646 0 */
		World.spawnNPC(598, new WorldTile(4525, 5646, 0), -1, false,
				EntityDirection.NORTH);
		/*//Kaqemeex spawned by oracle
		455 - 4515 5649 0
		//Pikkupstix spawned by oracle
		6988 - 4515 5653 0 */
		World.spawnNPC(455, new WorldTile(4515, 5649, 0), -1, false,
				EntityDirection.EAST);
		World.spawnNPC(6988, new WorldTile(4515, 5653, 0), -1, false,
				EntityDirection.EAST);
		/* //Max spawned by oracle
		3373 - 4518 5647 0 */
		World.spawnNPC(3373, new WorldTile(4518, 5646, 0), -1, false,
				EntityDirection.NORTH);
		/* //Bob Barter (herbs) spawned by oracle
		6524 - 4519 5646 0 */
		World.spawnNPC(6524, new WorldTile(4519, 5646, 0), -1, false,
				EntityDirection.NORTH);
		/* //Xuan spawned by oracle
		13727 - 4525 5656 0 */
		World.spawnNPC(13727, new WorldTile(4525, 5656, 0), -1, false,
				EntityDirection.SOUTH);
		World.spawnNPC(8462, new WorldTile(4520, 5656, 0), -1, false,
				EntityDirection.SOUTH);
		World.spawnNPC(15558, new WorldTile(3678, 2968, 0), -1, false,
				EntityDirection.EAST);
		World.spawnObject(new WorldObject(2564, 10, 8192, 2551, 3077, 0), true);

		
		/**
		 * 
		 * OBJECTS
		 * 
		 */
		
		// Repair Stand
		World.spawnObject(new WorldObject(13715, 10, 1, 3676, 2964, 0), true);
		
		// Altar
		World.spawnObject(new WorldObject(13193, 10, 0, 4521, 5657, 0), true);
		
		// Ancient altar
		World.spawnObject(new WorldObject(6552, 10, 0, 4521, 5645, 0), true);
		
		// Lunar altar
		World.spawnObject(new WorldObject(17010, 10, 0, 4515, 5645, 0), true);
		
		// Zaros altar
		World.spawnObject(new WorldObject(47120, 10, 0, 4521, 5650, 0), true);
		
	/**
	 * 
	 * 
	 * END OF NEW HOME
	 * 
	 * 
	 */
	
	World.spawnObject(new WorldObject(13569, 10, -1, 3228, 3400, 0), true); //VARROCK PUB CIDER BEER
	World.spawnObject(new WorldObject(13571, 10, 0, 3284, 3492, 0), true); //NORTH VARROCK PUB GREENMAN BEER
	World.spawnObject(new WorldObject(13573, 10, 0, 3266, 3394, 0), true); //SOUTH EAST VARROCK PUB CHEF'S DELIGHT BEER
	World.spawnObject(new WorldObject(13571, 10, 0, 3220, 3497, 0), true); //SOUTH EAST VARROCK PUB GREENMAN BEER
	World.spawnObject(new WorldObject(13568, 10, 2, 3082, 3436, 0), true); //BARBARIAN VILLAGE PUB REGULAR BEER
	World.spawnObject(new WorldObject(13570, 10, -1, 2953, 3368, 0), true); //FALADOR PUB ASGARNIAN BEER
	World.spawnObject(new WorldObject(13568, 10, -1, 3044, 3255, 0), true); //PORT SARIM PUB REGULAR BEER
	World.spawnObject(new WorldObject(13570, 10, 0, 3363, 2958, 0), true); //POLLNIVNEACH PUB ASGARNIAN BEER
	World.spawnObject(new WorldObject(13569, 10, -1, 3157, 2980, 0), true); //BANDIT CAMP PUB CIDER BEER
		
		/**
		//Wizard Acantha spawned by oracle
		8031 - 1886 3180 0		
		*/
		World.spawnNPC(8031, new WorldTile(1886, 3180, 0), -1, false,
				EntityDirection.EAST);			
		/**
		 * //Grand Exchange clerk spawned by oracle
		2593 - 3180 3506 0
		//Grand Exchange clerk spawned by oracle
		2593 - 3181 3506 0
		 * 
		 */
		World.spawnNPC(2593, new WorldTile(3180, 3506, 0), -1, false,
				EntityDirection.NORTH);
		World.spawnNPC(2593, new WorldTile(3181, 3506, 0), -1, false,
				EntityDirection.NORTH);
		/**
		 * //Grand Exchange clerk spawned by oracle
		1419 - 3182 3504 0
		//Grand Exchange clerk spawned by oracle
		1419 - 3182 3505 0
		 * 
		 */
		World.spawnNPC(1419, new WorldTile(3182, 3504, 0), -1, false,
				EntityDirection.EAST);
		World.spawnNPC(1419, new WorldTile(3182, 3505, 0), -1, false,
				EntityDirection.EAST);
		/*
		 * //1419 - 3179 3504 0 
		 */
		World.spawnNPC(1419, new WorldTile(3179, 3504, 0), -1, false,
				EntityDirection.WEST);
		/*
		 * //1419 - 3179 3505 0 
		 */
		World.spawnNPC(1419, new WorldTile(3179, 3505, 0), -1, false,
				EntityDirection.WEST);
		/*
		 * //Shopkeeper spawned by oracle 522 - 5017 4396 0
		 */
		World.spawnNPC(522, new WorldTile(5017, 4396, 0), -1, false,
				EntityDirection.EAST);
		/*
		 * //Make-over Mage spawned by oracle 2676 - 5017 4394 0
		 */
		World.spawnNPC(2676, new WorldTile(5017, 4394, 0), -1, false,
				EntityDirection.EAST);
		/*
		 * //Bob spawned by oracle 519 - 3621 3367 0
		 */// armor repair npc
		World.spawnNPC(519, new WorldTile(3621, 3367, 0), -1, false,
				EntityDirection.WEST);
		/*
		 * //Horvik spawned by oracle 549 - 2850 3537 0
		 */
		World.spawnNPC(549, new WorldTile(2850, 3567, 0), -1, false,
				EntityDirection.WEST);
		/*
		 * //Hairdresser spawned by oracle 598 - 3608 3367 0 //Thessalia spawned
		 * by oracle 548 - 3609 3367 0
		 */
		World.spawnNPC(598, new WorldTile(3608, 3367, 0), -1, false,
				EntityDirection.SOUTH);
		World.spawnNPC(548, new WorldTile(3609, 3367, 0), -1, false,
				EntityDirection.SOUTH);
		// Xuan spawned by oracle
		/* 13727 - 3611 3367 0 */
		World.spawnNPC(13727, new WorldTile(3611, 3367, 0), -1, false,
				EntityDirection.SOUTH);
		World.spawnNPC(4405, new WorldTile(2550, 3078, 0), -1, false,
				EntityDirection.EAST);
		/*
		 * //null spawned by oracle 2676 - 3610 3367 0 This is the makeover mage
		 */
		World.spawnNPC(2676, new WorldTile(3610, 3367, 0), -1, false,
				EntityDirection.SOUTH);
		// Bow and Arrow salesman spawned by oracle
		/* 683 - 3616 3367 0 */
		World.spawnNPC(683, new WorldTile(3616, 3367, 0), -1, false,
				EntityDirection.SOUTH);
		// Horvik spawned by oracle
		/* 549 - 3617 3367 0 */
		World.spawnNPC(549, new WorldTile(3617, 3367, 0), -1, false,
				EntityDirection.SOUTH);
		// Shopkeeper spawned by oracle
		/* 520 - 3616 3362 0 */
		World.spawnNPC(520, new WorldTile(3616, 3362, 0), -1, false,
				EntityDirection.SOUTH);
		// max spawned by oracle id: 3373
		// coords 3609 3362
		World.spawnNPC(530, new WorldTile(3609, 3362, 0), -1, false,
				EntityDirection.NORTH);
		/*
		 * //Shop assistant spawned by oracle 552 - 3611 3362 0
		 */
		World.spawnNPC(552, new WorldTile(3611, 3362, 0), -1, false,
				EntityDirection.NORTH);
		/*
		 * //Shopkeeper spawned by oracle 522 - 3615 3362 0
		 */
		World.spawnNPC(522, new WorldTile(3615, 3362, 0), -1, false,
				EntityDirection.NORTH);
		/*
		 * //Shopkeeper spawned by plato 528 - 3599 3365 0
		 */
		World.spawnNPC(528, new WorldTile(3519, 3365, 0), -1, false,
				EntityDirection.NORTH);
		/*
		 * //Zaff spawned by oracle 546 - 3607 3360 0
		 */
		World.spawnNPC(546, new WorldTile(3607, 3360, 0), -1, false,
				EntityDirection.WEST);
		/*
		 * //Kaqemeex spawned by oracle 455 - 3607 3359 0 //Pikkupstix spawned
		 * by oracle 6988 - 3607 3358 0
		 */
		World.spawnNPC(455, new WorldTile(3607, 3359, 0), -1, false,
				EntityDirection.WEST);
		/*
		 * //Jatix spawned by oracle 587 - 3607 3369 0
		 */
		World.spawnNPC(587, new WorldTile(5022, 4397, 0), -1, false,
				EntityDirection.WEST);
		World.spawnNPC(13929, new WorldTile(3246, 3197, 0), -1, false,
				EntityDirection.WEST);
		// Fishing SPOT spawnings!
		World.spawnNPC(327, new WorldTile(2604, 3419, 0), -1, true, true);
		World.spawnNPC(6267, new WorldTile(2605, 3420, 0), -1, true, true);
		World.spawnNPC(312, new WorldTile(2605, 3421, 0), -1, true, true);
		World.spawnNPC(313, new WorldTile(2604, 3422, 0), -1, true, true);
		World.spawnNPC(952, new WorldTile(2603, 3422, 0), -1, true, true);
		World.spawnNPC(327, new WorldTile(2604, 3423, 0), -1, true, true);
		World.spawnNPC(6267, new WorldTile(2605, 3424, 0), -1, true, true);
		World.spawnNPC(312, new WorldTile(2605, 3425, 0), -1, true, true);
		World.spawnNPC(327, new WorldTile(2599, 3419, 0), -1, true, true);
		World.spawnNPC(6267, new WorldTile(2598, 3422, 0), -1, true, true);
		World.spawnNPC(8864, new WorldTile(2590, 3419, 0), -1, true, true);

		// Robust glass machine
		World.spawnObject(new WorldObject(67968, 10, 1, 5018, 4399, 0), true);


		/*
		 * //Wise Old Man spawned by oracle 2253 - 5026 4387 0
		 */
		World.spawnNPC(2253, new WorldTile(5026, 4837, 0), -1, false,
				EntityDirection.NORTH);

		/*
		 * //Xuan spawned by oracle 13727 - 5026 4397 0
		 */
		World.spawnNPC(13727, new WorldTile(5026, 4397, 0), -1, false,
				EntityDirection.SOUTH);

		/*
		 * //Spria spawned by oracle 8462 - 5030 4399 0
		 */
		World.spawnNPC(8462, new WorldTile(5030, 4389, 0), -1, false,
				EntityDirection.WEST);

		/*
		 * //Wise Old Man spawned by oracle 2253 - 5030 4395 0
		 */
		World.spawnNPC(2253, new WorldTile(5030, 4395, 0), -1, false,
				EntityDirection.WEST);

		// Bob Barter
		World.spawnNPC(6524, new WorldTile(5016, 4388, 0), -1, false,
				EntityDirection.EAST);
	}

	public static void deleteObjects() {

		/**
		 * 
		 * NEW HOME OBJECTS
		 * 
		 */
		World.deleteObject(new WorldTile(4525, 5656, 0));
		World.deleteObject(new WorldTile(4521, 5647, 0));
		World.deleteObject(new WorldTile(4519, 5646, 0));
		
		/**
		 * 
		 * END OF NEW HOME OBJECTS
		 * 
		 */
		World.deleteObject(new WorldTile(2354, 3169, 0));
		World.deleteObject(new WorldTile(2354, 3173, 0));
		World.deleteObject(new WorldTile(2354, 3172, 0));
		World.deleteObject(new WorldTile(2355, 3172, 0));
		World.deleteObject(new WorldTile(2355, 3174, 0));
		World.deleteObject(new WorldTile(2354, 3174, 0));
		World.deleteObject(new WorldTile(2354, 3171, 0));
		World.deleteObject(new WorldTile(2355, 3171, 0));
		World.deleteObject(new WorldTile(2355, 3170, 0));
		World.deleteObject(new WorldTile(2354, 3170, 0));
		World.deleteObject(new WorldTile(2357, 3172, 0));
		World.deleteObject(new WorldTile(2357, 3173, 0));
		World.deleteObject(new WorldTile(2355, 3169, 0));
		World.deleteObject(new WorldTile(2351, 3169, 0));
		World.deleteObject(new WorldTile(2351, 3170, 0));
		World.deleteObject(new WorldTile(2351, 3168, 0));
		World.deleteObject(new WorldTile(2350, 3169, 0));
		World.deleteObject(new WorldTile(2351, 3174, 0));
		World.deleteObject(new WorldTile(2352, 3175, 0));
		World.deleteObject(new WorldTile(2350, 3174, 0));
		World.deleteObject(new WorldTile(2357, 3173, 0));
		World.deleteObject(new WorldTile(2357, 3170, 0));
		World.deleteObject(new WorldTile(2355, 3170, 0));
		World.deleteObject(new WorldTile(2336, 3175, 0));
		World.deleteObject(new WorldTile(2353, 3172, 1));
		World.deleteObject(new WorldTile(2353, 3171, 1));
		World.deleteObject(new WorldTile(2354, 3171, 1));
		World.deleteObject(new WorldTile(2354, 3172, 1));
		World.deleteObject(new WorldTile(4510, 5649, 0));
		/*----------2nd NEW HOME-----------------------------------*/
		World.deleteObject(new WorldTile(3040, 5844, 1));
				World.deleteObject(new WorldTile(3039, 5844, 1));
				World.deleteObject(new WorldTile(3047, 5844, 1));
				World.deleteObject(new WorldTile(3047, 5843, 1));
				World.deleteObject(new WorldTile(3048, 5844, 1));
				World.deleteObject(new WorldTile(3048, 5843, 1));
				World.deleteObject(new WorldTile(3048, 5842, 1));
				World.deleteObject(new WorldTile(3041, 5859, 1));
				World.deleteObject(new WorldTile(3035, 5870, 1));
				World.deleteObject(new WorldTile(3044, 5871, 1));
				World.deleteObject(new WorldTile(3046, 5867, 1));
				World.deleteObject(new WorldTile(3039, 5835, 1));
				World.deleteObject(new WorldTile(3039, 5836, 1));
				World.deleteObject(new WorldTile(3040, 5835, 1));
				World.deleteObject(new WorldTile(3048, 5840, 1));
				World.deleteObject(new WorldTile(3047, 5840, 1));
				World.deleteObject(new WorldTile(3046, 5854, 1));
				World.deleteObject(new WorldTile(3047, 5854, 1));
				World.deleteObject(new WorldTile(3047, 5853, 1));
				World.deleteObject(new WorldTile(3046, 5851, 1));
				World.deleteObject(new WorldTile(3047, 5852, 1));
				World.deleteObject(new WorldTile(3046, 5849, 1));
				World.deleteObject(new WorldTile(3047, 5848, 1));
				World.deleteObject(new WorldTile(3048, 5847, 1));
				World.deleteObject(new WorldTile(3047, 5847, 1));
				World.deleteObject(new WorldTile(3048, 5846, 1));
				World.deleteObject(new WorldTile(3049, 5847, 1));
				World.deleteObject(new WorldTile(3051, 5847, 1));
				World.deleteObject(new WorldTile(3050, 5845, 1));
				World.deleteObject(new WorldTile(3053, 5845, 1));
				World.deleteObject(new WorldTile(3055, 5847, 1));
				World.deleteObject(new WorldTile(3054, 5847, 1));
				World.deleteObject(new WorldTile(3055, 5854, 1));
				World.deleteObject(new WorldTile(3054, 5854, 1));
				World.deleteObject(new WorldTile(3055, 5862, 1));
				World.deleteObject(new WorldTile(3052, 5863, 1));
				World.deleteObject(new WorldTile(3055, 5863, 1));
				World.deleteObject(new WorldTile(3055, 5865, 1));
				World.deleteObject(new WorldTile(3055, 5866, 1));
				World.deleteObject(new WorldTile(3055, 5868, 1));
				World.deleteObject(new WorldTile(3052, 5866, 1));
				World.deleteObject(new WorldTile(3053, 5869, 1));
				World.deleteObject(new WorldTile(3054, 5872, 1));
				World.deleteObject(new WorldTile(3053, 5872, 1));
				World.deleteObject(new WorldTile(3051, 5868, 1));
				World.deleteObject(new WorldTile(3051, 5870, 1));
				World.deleteObject(new WorldTile(3050, 5869, 1));
				World.deleteObject(new WorldTile(3036, 5869, 1));
				World.deleteObject(new WorldTile(3040, 5866, 1));
				World.deleteObject(new WorldTile(3043, 5865, 1));
				World.deleteObject(new WorldTile(3047, 5868, 1));
				World.deleteObject(new WorldTile(3045, 5871, 1));
				World.deleteObject(new WorldTile(3044, 5873, 1));
				World.deleteObject(new WorldTile(3044, 5872, 1));
				World.deleteObject(new WorldTile(3044, 5869, 1));
				World.deleteObject(new WorldTile(3046, 5866, 1));
				World.deleteObject(new WorldTile(3046, 5864, 1));
				World.deleteObject(new WorldTile(3044, 5862, 1));
				World.deleteObject(new WorldTile(3044, 5861, 1));
				World.deleteObject(new WorldTile(3045, 5861, 1));
				World.deleteObject(new WorldTile(3043, 5871, 1));
				World.deleteObject(new WorldTile(3043, 5872, 1));
				World.deleteObject(new WorldTile(3042, 5872, 1));
				World.deleteObject(new WorldTile(3042, 5868, 1));
				World.deleteObject(new WorldTile(3042, 5869, 1));
				World.deleteObject(new WorldTile(3040, 5869, 1));
				World.deleteObject(new WorldTile(3038, 5872, 1));
				World.deleteObject(new WorldTile(3035, 5872, 1));
				World.deleteObject(new WorldTile(3033, 5871, 1));
				World.deleteObject(new WorldTile(3033, 5872, 1));
				World.deleteObject(new WorldTile(3032, 5872, 1));
				World.deleteObject(new WorldTile(3031, 5872, 1));
				World.deleteObject(new WorldTile(3031, 5871, 1));
				World.deleteObject(new WorldTile(3031, 5870, 1));
				World.deleteObject(new WorldTile(3034, 5868, 1));
				World.deleteObject(new WorldTile(3043, 5864, 1));
				World.deleteObject(new WorldTile(3043, 5863, 1));
				World.deleteObject(new WorldTile(3043, 5862, 1));
				World.deleteObject(new WorldTile(3043, 5861, 1));
				World.deleteObject(new WorldTile(3042, 5861, 1));
				World.deleteObject(new WorldTile(3039, 5863, 1));
				World.deleteObject(new WorldTile(3033, 5866, 1));
				World.deleteObject(new WorldTile(3031, 5866, 1));
				World.deleteObject(new WorldTile(3031, 5864, 1));
				World.deleteObject(new WorldTile(3033, 5864, 1));
				World.deleteObject(new WorldTile(3041, 5860, 1));
				World.deleteObject(new WorldTile(3032, 5849, 1));
				World.deleteObject(new WorldTile(3037, 5845, 1));
				World.deleteObject(new WorldTile(3038, 5845, 1));
				World.deleteObject(new WorldTile(3039, 5845, 1));
				World.deleteObject(new WorldTile(3040, 5845, 1));
				World.deleteObject(new WorldTile(3039, 5846, 1));
				World.deleteObject(new WorldTile(3040, 5846, 1));
				World.deleteObject(new WorldTile(3040, 5850, 1));
				World.deleteObject(new WorldTile(3062, 5861, 1));
				World.deleteObject(new WorldTile(3062, 5859, 1));
				World.deleteObject(new WorldTile(3062, 5858, 1));
				World.deleteObject(new WorldTile(3062, 5857, 1));
				World.deleteObject(new WorldTile(3062, 5856, 1));
				World.deleteObject(new WorldTile(3062, 5855, 1));
				World.deleteObject(new WorldTile(3031, 5845, 1));
				World.deleteObject(new WorldTile(3033, 5846, 1));
				World.deleteObject(new WorldTile(3035, 5845, 1));
				World.deleteObject(new WorldTile(3036, 5846, 1));
				World.deleteObject(new WorldTile(3031, 5848, 1));
				World.deleteObject(new WorldTile(3031, 5851, 1));
				World.deleteObject(new WorldTile(3031, 5853, 1));
				World.deleteObject(new WorldTile(3030, 5854, 1));
				World.deleteObject(new WorldTile(3031, 5854, 1));
				World.deleteObject(new WorldTile(3032, 5854, 1));
				World.deleteObject(new WorldTile(3033, 5852, 1));
				World.deleteObject(new WorldTile(3040, 5849, 1));
				World.deleteObject(new WorldTile(3039, 5848, 1));
				World.deleteObject(new WorldTile(3040, 5851, 1));
				World.deleteObject(new WorldTile(3039, 5850, 1));
				World.deleteObject(new WorldTile(3040, 5853, 1));
				World.deleteObject(new WorldTile(3041, 5861, 1));
				World.deleteObject(new WorldTile(3030, 5861, 1));
				World.deleteObject(new WorldTile(3030, 5863, 1));
				World.deleteObject(new WorldTile(3030, 5864, 1));
				World.deleteObject(new WorldTile(3029, 5864, 1));
				World.deleteObject(new WorldTile(3027, 5862, 1));
				World.deleteObject(new WorldTile(3026, 5864, 1));
				World.deleteObject(new WorldTile(3026, 5861, 1));
				World.deleteObject(new WorldTile(3023, 5863, 1));
				World.deleteObject(new WorldTile(3023, 5860, 1));
				World.deleteObject(new WorldTile(3024, 5857, 1));
				World.deleteObject(new WorldTile(3024, 5859, 1));
				World.deleteObject(new WorldTile(3024, 5856, 1));
				World.deleteObject(new WorldTile(3023, 5851, 1));
				World.deleteObject(new WorldTile(3025, 5852, 1));
				World.deleteObject(new WorldTile(3026, 5853, 1));
				World.deleteObject(new WorldTile(3027, 5852, 1));
				World.deleteObject(new WorldTile(3062, 5854, 1));
				World.deleteObject(new WorldTile(3063, 5858, 1));
				World.deleteObject(new WorldTile(3056, 5863, 1));
				World.deleteObject(new WorldTile(3057, 5863, 1));
				World.deleteObject(new WorldTile(3060, 5861, 1));
				World.deleteObject(new WorldTile(3060, 5859, 1));
				World.deleteObject(new WorldTile(3060, 5858, 1));
				World.deleteObject(new WorldTile(3060, 5857, 1));
				World.deleteObject(new WorldTile(3060, 5856, 1));
				World.deleteObject(new WorldTile(3060, 5855, 1));
				World.deleteObject(new WorldTile(3060, 5854, 1));
				World.deleteObject(new WorldTile(3058, 5861, 1));
				World.deleteObject(new WorldTile(3058, 5859, 1));
				World.deleteObject(new WorldTile(3058, 5858, 1));
				World.deleteObject(new WorldTile(3058, 5857, 1));
				World.deleteObject(new WorldTile(3058, 5856, 1));
				World.deleteObject(new WorldTile(3058, 5855, 1));
				World.deleteObject(new WorldTile(3058, 5854, 1));
				World.deleteObject(new WorldTile(3062, 5860, 1));
				World.deleteObject(new WorldTile(3031, 5855, 1));
				World.deleteObject(new WorldTile(3032, 5855, 1));
				World.deleteObject(new WorldTile(3029, 5851, 1));
				World.deleteObject(new WorldTile(3030, 5851, 1));
				World.deleteObject(new WorldTile(3030, 5852, 1));
				World.deleteObject(new WorldTile(3030, 5853, 1));
				World.deleteObject(new WorldTile(3056, 5864, 1));
				World.deleteObject(new WorldTile(3057, 5864, 1));
				World.deleteObject(new WorldTile(3060, 5864, 1));
				World.deleteObject(new WorldTile(3064, 5864, 1));
				World.deleteObject(new WorldTile(3056, 5858, 1));
				World.deleteObject(new WorldTile(3064, 5859, 1));
				World.deleteObject(new WorldTile(3064, 5855, 1));
				World.deleteObject(new WorldTile(3064, 5851, 1));
				World.deleteObject(new WorldTile(3060, 5851, 1));
				World.deleteObject(new WorldTile(3060, 5860, 1));
				World.deleteObject(new WorldTile(3060, 5860, 1));
				World.deleteObject(new WorldTile(3058, 5860, 1));
				World.deleteObject(new WorldTile(3055, 5855, 1));
				World.deleteObject(new WorldTile(3054, 5855, 1));
				World.deleteObject(new WorldTile(3040, 5860, 1));
				World.deleteObject(new WorldTile(3042, 5860, 1));
				World.deleteObject(new WorldTile(3044, 5860, 1));
				World.deleteObject(new WorldTile(3045, 5860, 1));
				World.deleteObject(new WorldTile(3041, 5853, 1));
				World.deleteObject(new WorldTile(3041, 5852, 1));
				World.deleteObject(new WorldTile(3041, 5851, 1));
				World.deleteObject(new WorldTile(3045, 5851, 1));
				World.deleteObject(new WorldTile(3045, 5850, 1));
				World.deleteObject(new WorldTile(3045, 5849, 1));
				World.deleteObject(new WorldTile(3045, 5848, 1));
				World.deleteObject(new WorldTile(3045, 5847, 1));
				World.deleteObject(new WorldTile(3045, 5835, 1));
				World.deleteObject(new WorldTile(3045, 5836, 1));
				World.deleteObject(new WorldTile(3047, 5835, 1));
				World.deleteObject(new WorldTile(3050, 5835, 1));
				World.deleteObject(new WorldTile(3050, 5836, 1));
				World.deleteObject(new WorldTile(3050, 5839, 1));
				World.deleteObject(new WorldTile(3047, 5839, 1));
				World.deleteObject(new WorldTile(3050, 5840, 1));
				World.deleteObject(new WorldTile(3048, 5842, 1));
				World.deleteObject(new WorldTile(3050, 5840, 1));
				World.deleteObject(new WorldTile(3048, 5842, 1));
				World.deleteObject(new WorldTile(3050, 5841, 1));
				World.deleteObject(new WorldTile(3050, 5842, 1));
				World.deleteObject(new WorldTile(3050, 5843, 1));
				World.deleteObject(new WorldTile(3050, 5844, 1));
				World.deleteObject(new WorldTile(3049, 5844, 1));
				
		/*-------------------END OF 2ND NEW HOME-----------------------------------*/
	/*-----------------------Donator Zone---------------------------------------*/
				World.deleteObject(new WorldTile(2140, 3896, 0));
				World.deleteObject(new WorldTile(2143, 3911, 0));
				World.deleteObject(new WorldTile(2138, 3912, 0));
				World.deleteObject(new WorldTile(2140, 3914, 0));
				World.deleteObject(new WorldTile(2141, 3914, 0));
				World.deleteObject(new WorldTile(2143, 3912, 0));
				World.deleteObject(new WorldTile(2144, 3910, 0));
				World.deleteObject(new WorldTile(2143, 3910, 0));
				World.deleteObject(new WorldTile(2142, 3910, 0));
				World.deleteObject(new WorldTile(2137, 3909, 0));
				World.deleteObject(new WorldTile(2136, 3909, 0));
				World.deleteObject(new WorldTile(2136, 3908, 0));
				World.deleteObject(new WorldTile(2139, 3905, 0));
				World.deleteObject(new WorldTile(2140, 3905, 1));
				World.deleteObject(new WorldTile(2141, 3905, 0));
				World.deleteObject(new WorldTile(2141, 3906, 0));
				World.deleteObject(new WorldTile(2143, 3906, 0));
				World.deleteObject(new WorldTile(2142, 3905, 0));
				World.deleteObject(new WorldTile(2140, 3905, 0));
				World.deleteObject(new WorldTile(2139, 3891, 0));
				World.deleteObject(new WorldTile(2136, 3893, 0));
				World.deleteObject(new WorldTile(2139, 3890, 0));
				World.deleteObject(new WorldTile(2136, 3892, 0));
				World.deleteObject(new WorldTile(2141, 3907, 0));
				World.deleteObject(new WorldTile(2142, 3909, 0));
				World.deleteObject(new WorldTile(2137, 3912, 0));
				World.deleteObject(new WorldTile(2137, 3914, 0));
				World.deleteObject(new WorldTile(2139, 3915, 0));
				World.deleteObject(new WorldTile(2139, 3916, 0));
				World.deleteObject(new WorldTile(2140, 3916, 0));
				World.deleteObject(new WorldTile(2143, 3913, 0));
				World.deleteObject(new WorldTile(2142, 3913, 0));
				World.deleteObject(new WorldTile(2142, 3911, 0));
				World.deleteObject(new WorldTile(2143, 3909, 0));
				World.deleteObject(new WorldTile(2143, 3908, 0));
				World.deleteObject(new WorldTile(2143, 3907, 0));
				World.deleteObject(new WorldTile(2140, 3908, 0));
				World.deleteObject(new WorldTile(2143, 3905, 0));
				World.deleteObject(new WorldTile(2144, 3905, 0));
				World.deleteObject(new WorldTile(2140, 3897, 1));
				World.deleteObject(new WorldTile(2140, 3906, 0));
				World.deleteObject(new WorldTile(2140, 3893, 0));
				World.deleteObject(new WorldTile(2142, 3893, 0));
				World.deleteObject(new WorldTile(2144, 3892, 0));
				World.deleteObject(new WorldTile(2144, 3890, 0));
				World.deleteObject(new WorldTile(2144, 3891, 0));
				World.deleteObject(new WorldTile(2139, 3889, 0));
				World.deleteObject(new WorldTile(2138, 3888, 0));
				World.deleteObject(new WorldTile(2137, 3888, 0));
				World.deleteObject(new WorldTile(2137, 3889, 0));
				World.deleteObject(new WorldTile(2141, 3888, 0));
				World.deleteObject(new WorldTile(2143, 3888, 0));
				World.deleteObject(new WorldTile(2141, 3896, 0));
				World.deleteObject(new WorldTile(2142, 3896, 0));
				World.deleteObject(new WorldTile(2139, 3891, 0));
				World.deleteObject(new WorldTile(2141, 3891, 0));
				World.deleteObject(new WorldTile(2141, 3890, 0));
				World.deleteObject(new WorldTile(2142, 3890, 0));
				World.deleteObject(new WorldTile(2143, 3890, 0));
				World.deleteObject(new WorldTile(2143, 3901, 0));
				World.deleteObject(new WorldTile(2139, 3909, 1));
				World.deleteObject(new WorldTile(2139, 3905, 1));
				World.deleteObject(new WorldTile(2136, 3903, 1));
				World.deleteObject(new WorldTile(2137, 3902, 1));
				World.deleteObject(new WorldTile(2136, 3902, 1));
				World.deleteObject(new WorldTile(2136, 3901, 1));
				World.deleteObject(new WorldTile(2136, 3899, 1));
				World.deleteObject(new WorldTile(2144, 3909, 1));
				/*--------End of Donator Zone -------- */	
				
	}

	/**
	 * The NPC classes.
	 */
	private static final Map<Integer, Class<?>> CUSTOM_NPCS = new HashMap<Integer, Class<?>>();

	public static void npcSpawn() {
		int size = 0;
		boolean ignore = false;
		try {
			for (String string : FileUtilities.readFile("data/npcs/spawns.txt")) {
				if (string.startsWith("//") || string.equals("")) {
					continue;
				}
				if (string.contains("/*")) {
					ignore = true;
					continue;
				}
				if (ignore) {
					if (string.contains("*/")) {
						ignore = false;
					}
					continue;
				}
				String[] spawn = string.split(" ");
				@SuppressWarnings("unused")
				int id = Integer.parseInt(spawn[0]), x = Integer
						.parseInt(spawn[1]), y = Integer.parseInt(spawn[2]), z = Integer
						.parseInt(spawn[3]), faceDir = Integer
						.parseInt(spawn[4]);
				NPC npc = null;
				Class<?> npcHandler = CUSTOM_NPCS.get(id);
				if (npcHandler == null) {
					npc = new NPC(id, new WorldTile(x, y, z), -1, true, false);
				} else {
					npc = (NPC) npcHandler.getConstructor(int.class)
							.newInstance(id);
				}
				if (npc != null) {
					WorldTile spawnLoc = new WorldTile(x, y, z);
					npc.setLocation(spawnLoc);
					World.spawnNPC(npc.getId(), spawnLoc, -1, true, false);
					size++;
				}
			}
		} catch (NumberFormatException e1) {
			e1.printStackTrace();
		} catch (IllegalArgumentException e1) {
			e1.printStackTrace();
		} catch (SecurityException e1) {
			e1.printStackTrace();
		} catch (IOException e1) {
			e1.printStackTrace();
		} catch (InstantiationException e1) {
			e1.printStackTrace();
		} catch (IllegalAccessException e1) {
			e1.printStackTrace();
		} catch (InvocationTargetException e1) {
			e1.printStackTrace();
		} catch (NoSuchMethodException e1) {
			e1.printStackTrace();
		}
		System.err.println("Loaded " + size + " custom npc spawns!");
	}

}